<!--运输管理-->
<template>
  <div>
    <div v-if="examine">
      <!--搜索条件-->
      <div class="order">
        <el-form :inline="true" :model="formInline" class="demo-form-inline">
          <el-form-item label="转移联单号">
            <el-input v-model="formInline.orderNum" placeholder="转移联单号"></el-input>
          </el-form-item>
          <el-form-item label="处置单位">
            <el-select v-model="formInline.dpCompany" placeholder="处置单位">
              <el-option :label="item.companyName" :value="item.id" v-for="item in dpCompanyList" :key="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="运输单位">
            <el-select v-model="formInline.ysCompany" placeholder="运输单位">
              <el-option :label="item.companyName" :value="item.id" v-for="item in ysCompanyList" :key="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="状态" class="status">
            <el-select v-model="formInline.status" placeholder="状态">
              <el-option label="已完成" value="1"></el-option>
              <el-option label="流程中" value="0"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="运输时间">
            <el-date-picker v-model="formInline.datePicker" type="datetimerange" :picker-options="pickerOptions2" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd"></el-date-picker>
          </el-form-item>
          <el-form-item label="司机" class="wasteType">
            <el-input v-model="formInline.driverName"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="searchResult">查询</el-button>
            <el-button type="default" @click="resetConditions">重置</el-button>
          </el-form-item>
        </el-form>
      </div>
      <!--表格展示-->
      <div class="tables">
        <div class="menuList">
          <ul class="menuTitle">
            <li>
              <span>序号</span>
            </li>
            <li>
              <span>运输单位</span>
            </li>
            <li>
              <span>处置单位</span>
            </li>
            <li>
              <span>司机</span>
            </li>
            <li>
              <span>运输时间</span>
            </li>
            <li>
              <span>车牌照号</span>
            </li>
            <li>
              <span>挂车牌照号</span>
            </li>
            <li>
              <span>状态</span>
            </li>
            <li>
              <span>操作</span>
            </li>
          </ul>
          <ul class="menuBody">
            <li class="menuitem currentParentMenu" v-for="(item,index) in tables" :key="item.id" style="border-bottom: 1px solid #ebeef5">
              <div style="width: 100%;" class="line">
                <div>
                  <!--  <i class="el-icon-circle-plus-outline" style="margin-right: 5px;" @click="unfold($event,item.id)"></i> -->
                  <span>{{++index}}</span>
                </div>
                <!-- <div>
                  <span>{{item.wfCompany}}</span>
                </div> -->
                <div>
                  <span>{{item.ysName}}</span>
                </div>
                <div>
                  <span>{{item.pdName}}</span>
                </div>
                <div>
                  <span>{{item.driverName}}</span>
                </div>
                <div>
                  <span>{{$dateFormat(item.transportationTime,'yyyy-MM-dd hh:mm:ss')}}</span>
                </div>
                <div>
                  <span>{{item.carNumber}}</span>
                </div>
                <div>
                  <span>{{item.trailerNumber}}</span>
                </div>
                <div>
                  <!-- 0流程中 1:已装货 2已完成 -1 异常 -->
                  <span>{{item.state===0?'流程中':item.state===1?'待装车':item.state===2?'待卸车':item.state===3?'已完成':'异常'}}</span>
                </div>
                <div>
                  <a href="javascript:;" @click="unfolds($event,item.id,'/op/dispatch/findInfo')" class="open">展开</a>
                </div>
              </div>
              <ol class="subMenu">
                <li class="subItem" v-for="son in item.children" :key="son.id">
                  <div>
                    <span>转移联单号：{{son.orderCode}}</span>
                  </div>
                  <div>
                    <span>产废单位：{{son.wfCompany}}</span>
                  </div>
                  <div>
                    <span>危废名称：{{son.origin}}</span>
                  </div>
                  <div>
                    <span>危废代码：{{son.wfCode}}</span>
                  </div>
                  <div>
                    <span>拟运重量：{{son.weight}}</span>
                  </div>
                  <!-- //0:未处理 1调度已确认 2运输已确认 3卸货已确认 -1调度取消 -2运输取消 -3 卸货已取消 -->
                  <div>
                    <span>状态：{{son.state===0?'未处理':son.state===1?'待运输':son.state===2?'待卸车':son.state===3?'已完成':'异常'}}</span>
                  </div>
                  <div>
                    <a href="javascript:;" @click="handleView(son)">查看</a>
                    <template v-if='son.state==2'>
                      <a href="javascript:;" style='color: #f40' v-if='currentCompanyType==3&&son.ysTConfirm!=null'>已装车</a>
                    </template>
                    <a href="javascript:;"></a>
                    <template v-if='son.state==1'>
                      <a href="javascript:;" @click="handleXC(son)" v-if='(currentCompanyType==3||currentCompanyType==4)&&son.ysTConfirm==null'>装车</a>
                    </template>
                    <!--  <a href="javascript:;" v-if='son.dpTConfirm==null'>处置待确认</a>
                    <a href="javascript:;" v-if='currentCompanyType==3&&son.wfTConfirm==null'>产废待确认</a> -->
                    <template v-if='son.state==2'>
                      <a href="javascript:;" @click="handleXC(son)" v-if='currentCompanyType==2&&son.dpUConfirm==null'>卸车</a>
                      <!-- <a href="javascript:;" @click="handleView(item)">确认</a> -->
                    </template>
                  </div>
                  <!-- 0:手动预警 1：自动预警 2：封袋提示 3：运输申请 4:重新确认 5:调度确认 6:运输确认 -->
                  <!--  <div>
                    <span>通知：{{son.warnType===0?'手动预警':son.warnType===1?'自动预警':son.warnType==null?'手动预警':''}}</span>
                  </div> -->
                </li>
              </ol>
            </li>
          </ul>
        </div>
      </div>
      <!--页数展示-->
      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="10" layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination>
    </div>
    <div v-if="!examine">
      <el-button type="text" size="medium" @click="dexamineGoBack">返回</el-button>
      <div class="statement">
        <div class="statementH">
          <span>危险废物转移联单</span>
        </div>
        <div class="statementNumber">
          <span>经营协议编号：{{constractNo}}</span>
          <div class="statementNumberImage">测试图片</div>
        </div>
        <div class="statementC">
          <div class="statementCO">
            <div class="statementCOH">第一部分：废物产废单位</div>
            <div class="statementCOHO">
              <el-form :model="firstSection" label-position="center" inline class="statementCOH-form">
                <el-row>
                  <el-col :span="5" :offset="1">
                    <el-form-item label="产生单位:">
                      <span>{{ firstSection.CGUS }}</span>
                    </el-form-item>
                  </el-col>
                  <el-col :span="5" :offset="1">
                    <el-form-item label="电话:">
                      <span>{{ firstSection.CGUSphone }}</span>
                    </el-form-item>
                  </el-col>
                  <el-col :span="5" :offset="1">
                    <el-form-item label="通讯地址:">
                      <span>{{ firstSection.CGUSmd }}</span>
                    </el-form-item>
                  </el-col>
                  <el-col :span="5" :offset="1">
                    <el-form-item label="邮编:">
                      <span>{{ firstSection.CGUSpostcode }}</span>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="5" :offset="1">
                    <el-form-item label="运输单位:">
                      <span>{{ firstSection.trafficunit }}</span>
                    </el-form-item>
                  </el-col>
                  <el-col :span="5" :offset="1">
                    <el-form-item label="电话:">
                      <span>{{ firstSection.trafficunitPhone }}</span>
                    </el-form-item>
                  </el-col>
                  <el-col :span="5" :offset="1">
                    <el-form-item label="通讯地址:">
                      <span>{{ firstSection.trafficunitMD }}</span>
                    </el-form-item>
                  </el-col>
                  <el-col :span="5" :offset="1">
                    <el-form-item label="邮编:">
                      <span>{{ firstSection.trafficunitPC }}</span>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="5" :offset="1">
                    <el-form-item label="接收单位:">
                      <span>{{ firstSection.receiver }}</span>
                    </el-form-item>
                  </el-col>
                  <el-col :span="5" :offset="1">
                    <el-form-item label="电话:">
                      <span>{{ firstSection.receiverPhone }}</span>
                    </el-form-item>
                  </el-col>
                  <el-col :span="5" :offset="1">
                    <el-form-item label="通讯地址:">
                      <span>{{ firstSection.receiverMD }}</span>
                    </el-form-item>
                  </el-col>
                  <el-col :span="5" :offset="1">
                    <el-form-item label="邮编:">
                      <span>{{ firstSection.receiverPC }}</span>
                    </el-form-item>
                  </el-col>
                </el-row>
                <div class="statementCOHT">
                  <el-row>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="废物名称:">
                        <span>{{ firstSection.wasteName }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="类别编号:">
                        <span>{{ firstSection.wasteType }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="数量（   吨   ）:">
                        <span>{{ firstSection.wasteCount }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="经营协议总量（吨）:">
                        <span>{{ firstSection.originCount }}</span>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="转移剩余量（吨）:">
                        <span>{{ firstSection.transferRemainCount }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="7" :offset="1">
                      <el-form-item label="废物特性:">
                        <span>{{ firstSection.wastePoints }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="3" :offset="1">
                      <el-form-item label="形态:">
                        <span>{{ firstSection.wasteForm }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="3" :offset="1">
                      <el-form-item label="包装方式:">
                        <span>{{ firstSection.packagedForm }}</span>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="7" :offset="1">
                      <el-form-item label="外运目的:">
                        <el-checkbox-group v-model='firstSection.transferPurpose'>
                          <el-checkbox value='1' label="中转贮存" disabled></el-checkbox>
                          <el-checkbox value='2' label="利用" disabled></el-checkbox>
                          <el-checkbox value='3' label="处理" disabled></el-checkbox>
                          <el-checkbox value='4' label="处置" disabled></el-checkbox>
                        </el-checkbox-group>
                      </el-form-item>
                    </el-col>
                    <el-col :span="7" :offset="1">
                      <el-form-item label="主要危险成分:">
                        <span>{{ firstSection.mainDangerous }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="7" :offset="1">
                      <el-form-item label="禁忌与应急措施:">
                        <span>{{ firstSection.forbbidenAndWays }}</span>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="发运人:">
                        <span>{{ firstSection.beginTransferMan }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="运达地:">
                        <span>{{ firstSection.destination }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="转移时间:">
                        <span>{{ firstSection.transferTimer }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="签字确认:">
                        <span>{{ firstSection.signConfirm }}</span>
                      </el-form-item>
                    </el-col>
                  </el-row>
                </div>
              </el-form>
            </div>
          </div>
          <div class="statementCT">
            <div class="statementCTH">第二部分：废物运输单位</div>
            <div class="statementCTHO">
              <el-form :model="secondSection" label-position="center" inline class="statementCOH-form">
                <div v-for='item in secondSections'>
                  <el-row>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="第一承运人:">
                        <span>{{ item.ysName }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="运输日期:">
                        <span>{{$dateFormat(item.transportationTime,'yyyy-MM-dd hh:mm:ss')}}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="道路运输证号:">
                        <span>{{ roadLicenseNumber }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="运输起点:">
                        <span>{{ beginAddress }}</span>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="经由地:">
                        <span>{{ item.byPoint }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="运输终点:">
                        <span>{{ item.pdAddress }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="车（船）型:">
                        <span>{{ item.trailerNumber?'大':'小' }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="牌照号:">
                        <span>{{ item.carNumber }}</span>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="5" :offset="1">
                      <el-form-item label=" 挂车牌照号:">
                        <span>{{ item.trailerNumber }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="司机:">
                        <span>{{ item.driverName }}</span>
                      </el-form-item>
                    </el-col>
                    <el-col :span="5" :offset="1">
                      <el-form-item label="确认签字:">
                        <span>{{ item.desc }}</span>
                      </el-form-item>
                    </el-col>
                  </el-row>
                </div>
              </el-form>
            </div>
          </div>
          <div class="statementCW">
            <div class="statementCWH">第三部分：废物接收单位</div>
            <div class="statementCWHO">
              <el-form :model="thirdSection" label-position="center" inline class="statementCOH-form">
                <el-row>
                  <el-col :span="5" :offset="1">
                    <el-form-item label="经营许可证号:">
                      <span>{{ thirdSection.organizationCode }}</span>
                    </el-form-item>
                  </el-col>
                  <el-col :span="5" :offset="1">
                    <el-form-item label="接收日期:">
                      <span>{{ thirdSection.unloadingAt }}</span>
                    </el-form-item>
                  </el-col>
                  <el-col :span="5" :offset="1">
                    <el-form-item label="实际接收量:">
                      <span>{{ thirdSection.unloadingAw }}</span>
                    </el-form-item>
                  </el-col>
                  <el-col :span="5" :offset="1">
                    <el-form-item label="经办人:">
                      <span>{{ thirdSection.linkMan }}</span>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row>
                  <el-col :span="11" :offset="1">
                    <el-form-item label="废物处置方式:">
                      <el-checkbox-group v-model='thirdSection.disposalMethod'>
                        <el-checkbox value='1' label="利用" disabled></el-checkbox>
                        <el-checkbox value='2' label="贮存" disabled></el-checkbox>
                        <el-checkbox value='3' label="焚烧" disabled></el-checkbox>
                        <el-checkbox value='4' label="安全填埋" disabled></el-checkbox>
                        <el-checkbox value='4' label="其他" disabled></el-checkbox>
                      </el-checkbox-group>
                    </el-form-item>
                  </el-col>
                  <el-col :span="11" :offset="1">
                    <el-form-item label="签字确认:">
                      <span>{{ thirdSection.dpSign }}</span>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
            </div>
          </div>
        </div>
        <div class="statementTable">
          <el-table :data="statementTables" border style="width: 100%" class="statementTables">
            <el-table-column prop="createCompany" label="公司"></el-table-column>
            <el-table-column prop="warnTitle" label="操作"></el-table-column>
            <el-table-column prop="warnContent" label="内容"></el-table-column>
            <el-table-column label="操作时间">
              <template slot-scope='scope'>
                <span>{{$dateFormat(scope.row.createAt,'yyyy-MM-dd hh:mm:ss')}}</span>
              </template>
            </el-table-column>
            <el-table-column label="状态">
              <template slot-scope='scope'>
                <span>{{scope.row.isConfirm==0?'未确认':'已确认'}}</span>
              </template>
            </el-table-column>
            <el-table-column prop="createName" label="操作人"></el-table-column>
          </el-table>
        </div>
        <div class="isFiltratecheckboxButtom" style="padding-bottom: 80px;margin-top: 30px;">
          <el-row>
            <el-col :span="4" :offset="10">
              <el-button type="primary" @click="examineSelection()">关闭</el-button>
            </el-col>
          </el-row>
        </div>
      </div>
    </div>
    <el-dialog title="提示" :visible.sync="dialogVisible" width="60%">
      <div class="updatePrivew">
        <div class="topInfo">
          <span>危废代码：{{wfCodes}}</span>
          <span>拟运总量：{{wantCount}}吨</span>
          <span>装车总量：{{loadCount}}吨</span>
          <span>接收总量：{{reciverCount}}吨</span>
        </div>
        <el-table :data="updateView" style="width: 100%">
          <el-table-column type="index" label="序号" width="60">
          </el-table-column>
          <el-table-column prop="wfName" label="危废种类">
          </el-table-column>
          <el-table-column prop="wfWeight" label="拟运重量">
          </el-table-column>
          <!-- 这个是装车 -->
          <template v-if='currentCompanyType==3'>
            <el-table-column label="装车重量">
              <template slot-scope='scope'>
                <el-input v-model='scope.row.loadingWeight' @input='getLoadingWeight(scope.row.loadingWeight,scope.row.id)'></el-input>
              </template>
            </el-table-column>
            <el-table-column prop="unloadingWeight" label="接收重量">
            </el-table-column>
          </template>
          <!-- 下面2个是卸车 -->
          <template v-if='currentCompanyType==2'>
            <el-table-column prop="loadingWeight" label="装车重量">
            </el-table-column>
            <el-table-column prop="unloadingWeight" label="接收重量">
              <template slot-scope='scope'>
                <el-input v-model='scope.row.unloadingWeight' @input='getInputValue(scope.row.unloadingWeight,scope.row.id)'></el-input>
              </template>
            </el-table-column>
          </template>
          <el-table-column prop="wfCompany" label="单位">
          </el-table-column>
        </el-table>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="confirmUpdate">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  inject: ['reload'],
  data() {
    return {
      examine: true,
      value5: "",
      tables: [],
      dialogVisible: false,
      formexamine: {},

      formInline: {
        orderNum: "",
        dpCompany: "",
        ysCompany: "",
        status: "",
        datePicker: [],
        driverName: "",
        endTime: "",
        startTime: ""
      },
      // 五联单第一部分数据
      firstSection: {
        CGUS: '',
        CGUSphone: '',
        CGUSmd: '',
        CGUSpostcode: '',
        trafficunit: '',
        trafficunitPhone: '',
        trafficunitMD: '',
        trafficunitPC: '',
        receiver: '',
        receiverPhone: '',
        receiverMD: '',
        receiverPC: '',
        wasteName: '',
        wasteType: '',
        wasteCount: '',
        originCount: '',
        transferRemainCount: '',
        wastePoints: '',
        wasteForm: '',
        packagedForm: "",
        transferPurpose: [],
        mainDangerous: '',
        forbbidenAndWays: '',
        beginTransferMan: '',
        destination: '',
        transferTimer: '',
        signConfirm: ''
      },
      // 第二部分数据
      secondSections: [],
      secondSection: {},
      // 第三部分数据
      thirdSection: {
        organizationCode: '',
        unloadingAt: '',
        unloadingAw: '',
        linkMan: '',
        disposalMethod: [],
        dpSign: ''
      },
      statementTables: [],

      pickerOptions2: {
        shortcuts: [{
            text: "最近一周",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            }
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            }
          },
          {
            text: "最近三个月",
            onClick(picker) {
              const end = new Date();
              const start = new Date();
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
              picker.$emit("pick", [start, end]);
            }
          }
        ]
      },
      currentPage: 1,
      total: 0,
      page: 1,
      limit: 10,
      dpCompanyList: [],
      ysCompanyList: [],
      constractNo: '',
      roadLicenseNumber: '',
      beginAddress: '',
      currentCompanyType: '',
      updateView: [],
      wfCodes: '',
      wantCount: '',
      loadCount: '',
      reciverCount: ''
    };
  },
  mounted() {
    //   查询所有处置公司
    this.$common.$ajax("/sys/company/select", { companyType: 2 }, "get").then(res => {
      this.dpCompanyList = res.data.body;
    });
    //查询所有运输公司
    // 查询运输公司
    this.$common.$ajax("/sys/company/select", { companyType: 3 }, "get").then(res => {
      this.ysCompanyList = res.data.body;
    });
    // 初始化数据
    this.initList()

    // 获取当前账号公司类型
    this.currentCompanyType = localStorage.companyType
  },
  methods: {
    initList() {
      this.$common
        .$ajax(
          "/op/dispatch/findList", {
            dpId: this.formInline.dpCompany,

            ysId: this.formInline.ysCompany,
            state: this.formInline.status,
            startTime: this.formInline.datePicker ?
              this.formInline.datePicker[0] : null,
            endTime: this.formInline.datePicker ?
              this.formInline.datePicker[1] : null,
            driverName: this.formInline.driverName
          },
          "get"
        )
        .then(res => {
          console.log(res.data);
          res.data.body.list.forEach(item => {
            item.children = [];
            this.$common
              .$ajax("/op/dispatch/findInfo", { id: item.id }, "get")
              .then(res => {

                item.children = res.data.body;
              });

          });
          this.tables = res.data.body.list;
          this.total = res.data.body.total;
        });
    },
    onSubmit() {
      console.log("submit!");
    },
    unfold(e, id) {
      var isUnfold = false;
      // 获取当前的子列表
      var child_node =
        e.currentTarget.parentElement.parentElement.nextElementSibling;
      if (e.currentTarget.classList.contains("el-icon-circle-plus-outline")) {
        child_node.style.display = "block";
        e.currentTarget.classList.add("el-icon-remove-outline");
        e.currentTarget.classList.remove("el-icon-circle-plus-outline");
        console.log("我是展开啦");
      } else {
        child_node.style.display = "none";
        e.currentTarget.classList.add("el-icon-circle-plus-outline");
        e.currentTarget.classList.remove("el-icon-remove-outline");
      }
    },
    unfolds(e, id, url) {
      var child_node =
        e.currentTarget.parentElement.parentElement.nextElementSibling;
      if (e.currentTarget.classList.contains("open")) {
        child_node.style.display = "block";
        e.currentTarget.classList.add("folder");
        e.currentTarget.classList.remove("open");
        e.target.innerHTML = '收起'
        console.log("我是展开啦");
      } else {
        child_node.style.display = "none";
        e.currentTarget.classList.add("open");
        e.currentTarget.classList.remove("folder");
        e.target.innerHTML = '展开'
      }
    },
    searchResult() {
      console.log(this.formInline);

      this.initList()
    },
    resetConditions() {
      for (let item in this.formInline) {
        if (Array.isArray(this.formInline[item])) {
          this.formInline[item] = []
        } else {
          this.formInline[item] = ''
        }
      }
      this.initList()
    },

    //查看
    handleView(row) {
      this.examine = false
      // 赋值
      // 请求数据
      this.$common.$ajax('/op/quintuplet/quintupletInfo', { transportId: row.id }, 'get').then(res => {
        console.log(res.data);
        // 由于返回的数据格式比较乱...所以 先吃饭吧！
        this.constractNo = res.data.body.opContract ? res.data.body.opContract.contractNo : ''; //合同编号
        this.dataArray = res.data.body;
        this.firstSection.CGUS = this.dataArray.wfCompany.companyName;
        this.firstSection.CGUSphone = this.dataArray.wfCompany.linkMobile;
        this.firstSection.CGUSmd = this.dataArray.wfCompany.address;
        this.firstSection.CGUSpostcode = this.dataArray.wfCompany.postCode
        this.firstSection.trafficunit = this.dataArray.ysCompany ? this.dataArray.ysCompany.companyName : ''
        this.firstSection.trafficunitPhone = this.dataArray.ysCompany ? this.dataArray.ysCompany.linkMobile : ''
        this.firstSection.trafficunitMD = this.dataArray.ysCompany ? this.dataArray.ysCompany.address : ''
        this.firstSection.trafficunitPC = this.dataArray.ysCompany ? this.dataArray.ysCompany.postCode : ''
        this.firstSection.receiver = this.dataArray.dpCompany.companyName
        this.firstSection.receiverPhone = this.dataArray.dpCompany.linkMobile
        this.firstSection.receiverMD = this.dataArray.dpCompany.address
        this.firstSection.receiverPC = this.dataArray.dpCompany.postCode
        this.firstSection.wasteName = this.dataArray.opOrder.origin
        this.firstSection.wasteType = this.dataArray.opOrder.wfCode
        this.firstSection.wasteCount = this.dataArray.opOrder.wfWeight
        this.firstSection.originCount = this.dataArray.opContract ? this.dataArray.opContract.totalWeight : ''
        this.firstSection.transferRemainCount = this.dataArray.opContract ? this.dataArray.opContract.surplusWeight : ''
        this.firstSection.wastePoints = this.dataArray.wfWasteType.characteristic
        this.firstSection.wasteForm = this.dataArray.wfWasteType.form
        this.firstSection.packagedForm = this.dataArray.wfWasteType.packingMethod
        // this.firstSection.transferPurpose = [] //外运目的
        // this.firstSection.transferPurpose = this.dataArray.wfWasteType.objective.split(',')
        this.firstSection.transferPurpose = this.dataArray.wfWasteType.objective.split(',').map(item => {
          return item == 1 ? '中装贮存' : item == 2 ? '利用' : item == 3 ? '处理' : '处置'
        })
        this.firstSection.mainDangerous = this.dataArray.wfWasteType.dangerousComponent
        this.firstSection.forbbidenAndWays = this.dataArray.wfWasteType.emergencyMeasure
        this.firstSection.beginTransferMan = this.dataArray.wfCompany.linkMan;
        this.firstSection.destination = this.dataArray.dpCompany.address
        this.firstSection.transferTimer = this.dataArray.opTransport.transportationTime || ''
        this.firstSection.signConfirm = ''
        console.log(this.firstSection.transferPurpose)
        // 第二部分赋值
        this.roadLicenseNumber = this.dataArray.ysCompany.roadLicenseNumber
        this.beginAddress = this.dataArray.ysCompany.address
        this.secondSections = res.data.body.opDispatchCarpools;

        // 第三部分赋值
        this.thirdSection.organizationCode = this.dataArray.dpCompany.organizationCode;
        this.thirdSection.unloadingAt = this.dataArray.opTransport.unloadingAt;
        this.thirdSection.unloadingAw = this.dataArray.opTransport.unloadingAw;
        this.thirdSection.linkMan = this.dataArray.dpCompany.linkMan;
        if (this.dataArray.dpCompany.disposalMethod) {
          this.thirdSection.disposalMethod = this.dataArray.dpCompany.disposalMethod.split(',').map(item => {
            return item == 1 ? '利用' : item == 2 ? '贮存' : item == 3 ? '焚烧' : item == 4 ? '安全填埋' : '其他'
          });
        } else {
          this.thirdSection.disposalMethod = null
        }

        this.thirdSection.dpSign = this.dataArray.opTransport.dpSign;


        this.statementTables = this.dataArray.opMessages
      })
    },
    getInputValue(val, id) {
      console.log('')
      console.log(val)
      console.log(id)
      this.updateView.forEach(item => {
        if (item.id == id && val <= item.total) {
          item.unloadingWeight = val
        }
      })
    },
    getLoadingWeight(val, id) {
      this.updateView.forEach(item => {
        if (item.id == id && val <= item.total) {
          item.loadingWeight = val
        }
      })
    },
    handleXC(row) {
      console.log(row)
      //this.examine = false//
      this.dialogVisible = true;
      this.wfCodes = row.wfCode;
      this.wantCount = row.weight;
      this.loadCount = row.loadingAw
      this.reciverCount = row.unloadingAw
      this.$common.$ajax('/op/quintuplet/quintupletInfo', { transportId: row.id }, 'get').then(res => {
        console.log(res.data);
        // 由于返回的数据格式比较乱...所以 先吃饭吧！
        this.constractNo = res.data.body.opContract ? res.data.body.opContract.contractNo : ''; //合同编号
        this.dataArray = res.data.body;
        this.firstSection.CGUS = this.dataArray.wfCompany.companyName;
        this.firstSection.CGUSphone = this.dataArray.wfCompany.linkMobile;
        this.firstSection.CGUSmd = this.dataArray.wfCompany.address;
        this.firstSection.CGUSpostcode = this.dataArray.wfCompany.postCode
        this.firstSection.trafficunit = this.dataArray.ysCompany ? this.dataArray.ysCompany.companyName : ''
        this.firstSection.trafficunitPhone = this.dataArray.ysCompany ? this.dataArray.ysCompany.linkMobile : ''
        this.firstSection.trafficunitMD = this.dataArray.ysCompany ? this.dataArray.ysCompany.address : ''
        this.firstSection.trafficunitPC = this.dataArray.ysCompany ? this.dataArray.ysCompany.postCode : ''
        this.firstSection.receiver = this.dataArray.dpCompany.companyName
        this.firstSection.receiverPhone = this.dataArray.dpCompany.linkMobile
        this.firstSection.receiverMD = this.dataArray.dpCompany.address
        this.firstSection.receiverPC = this.dataArray.dpCompany.postCode
        this.firstSection.wasteName = this.dataArray.opOrder.origin
        this.firstSection.wasteType = this.dataArray.opOrder.wfCode
        this.firstSection.wasteCount = this.dataArray.opOrder.wfWeight
        this.firstSection.originCount = this.dataArray.opContract ? this.dataArray.opContract.totalWeight : ''
        this.firstSection.transferRemainCount = this.dataArray.opContract ? this.dataArray.opContract.surplusWeight : ''
        this.firstSection.wastePoints = this.dataArray.wfWasteType.characteristic
        this.firstSection.wasteForm = this.dataArray.wfWasteType.form
        this.firstSection.packagedForm = this.dataArray.wfWasteType.packingMethod
        // this.firstSection.transferPurpose = [] //外运目的
        // this.firstSection.transferPurpose = this.dataArray.wfWasteType.objective.split(',')
        this.firstSection.transferPurpose = this.dataArray.wfWasteType.objective.split(',').map(item => {
          return item == 1 ? '中装贮存' : item == 2 ? '利用' : item == 3 ? '处理' : '处置'
        })
        this.firstSection.mainDangerous = this.dataArray.wfWasteType.dangerousComponent
        this.firstSection.forbbidenAndWays = this.dataArray.wfWasteType.emergencyMeasure
        this.firstSection.beginTransferMan = this.dataArray.wfCompany.linkMan;
        this.firstSection.destination = this.dataArray.dpCompany.address
        this.firstSection.transferTimer = this.dataArray.opTransport.transportationTime || ''
        this.firstSection.signConfirm = ''
        console.log(this.firstSection.transferPurpose)
        // 第二部分赋值
        this.roadLicenseNumber = this.dataArray.ysCompany.roadLicenseNumber
        this.beginAddress = this.dataArray.ysCompany.address
        this.secondSections = res.data.body.opDispatchCarpools;

        // 第三部分赋值
        this.thirdSection.organizationCode = this.dataArray.dpCompany.organizationCode;
        this.thirdSection.unloadingAt = this.dataArray.opTransport.unloadingAt;
        this.thirdSection.unloadingAw = this.dataArray.opTransport.unloadingAw;
        this.thirdSection.linkMan = this.dataArray.dpCompany.linkMan;
        if (this.dataArray.dpCompany.disposalMethod) {
          this.thirdSection.disposalMethod = this.dataArray.dpCompany.disposalMethod.split(',').map(item => {
            return item == 1 ? '利用' : item == 2 ? '贮存' : item == 3 ? '焚烧' : item == 4 ? '安全填埋' : '其他'
          });
        } else {
          this.thirdSection.disposalMethod = ''
        }

        this.thirdSection.dpSign = this.dataArray.opTransport.dpSign;


        this.statementTables = this.dataArray.opMessages
      })
      // 传入OrderId查询
      this.$common.$ajax('/op/order/findOrderInfo', { id: row.orderId }, 'get').then(res => {
        console.log(res.data.body)
        this.updateView = res.data.body
      })
    },
    //确认修改
    confirmUpdate() {
      var ParamsArr = new Array()
      // dfljdlkfjdlskf
      ParamsArr = this.updateView


      // if (this.currentCompanyType == 2) {
      //   ParamsArr.forEach(item => {

      //     item.unloadingWeight = item.unloadingWeight * 1000

      //   })
      // } else if (this.currentCompanyType == 3) {
      //   ParamsArr.forEach(item => {

      //     item.loadingWeight = item.loadingWeight * 1000

      //   })
      // }
      // ParamsArr.forEach(item=>{
      //   item.unloadingWeight = item.unloadingWeight
      // })
      this.$common.$ajax('/op/quintuplet/updateQuintuplet', ParamsArr, 'post').then(res => {
        if (res.data.status === 200) {
          if (this.currentCompanyType == 2) {
            this.$message({
              message: '卸车成功',
              type: 'success'
            })
            this.reload()
          } else if (this.currentCompanyType == 3) {
            this.$message({
              message: '装车成功',
              type: 'success'
            })
            this.reload()
          }

        }
      })
    },
    dexamineGoBack() {
      // this.examine = true;
      this.reload()
    },
    examineSelection() {
      this.examine = true;
      this.reload();
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.limit = val;
      this.initList()
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.page = val;
      this.initList()
    }
  },
  components: {}
};

</script>
<style lang="scss">
.demo-form-inline {
  padding-left: 20px;
}

.elHight {
  height: auto !important;
}

.order {
  border-radius: 10px;
  padding-top: 30px;
  background-color: #f7f7f7;
}

.result span {
  font-size: 15px;
  margin-left: 20px;
}

.speculation {
  margin-top: 10px;
}

//报表
.statement {
  padding-left: 30px;
  padding-right: 30px;
  background-color: #f7f7f7;
}

.statementH {
  padding-top: 20px;
  padding-bottom: 10px;
  text-align: center;
}

.statementH span {
  font-size: 35px;
}

.statementNumber {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
}

.statementNumber span {
  width: 530px;
  height: 115px;
  text-align: center;
  line-height: 115px;
  margin-left: 5%;
}

.statementNumberImage {
  width: 530px;
  height: 115px;
  margin-right: 5%;
}

.statementC {}

.statementCOH {
  font-size: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid #cccccc;
}

.statementCOH-form {
  padding-top: 20px;
}

.statementCOHO {
  // border-bottom: 1px solid #cccccc;
}

.statementCOHT {
  border-bottom: 1px solid #cccccc;
  border-top: 1px solid #cccccc;
  padding-top: 20px;
}

.statementCTH {
  padding-top: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #cccccc;
}

.statementCTHO {
  border-bottom: 1px solid #cccccc;
}

.statementCWH {
  padding-top: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #cccccc;
}

.statementCWHO {
  border-bottom: 1px solid #cccccc;
}

.statementTable {
  margin-top: 20px;
}

.statementTable {
  border: 1px solid #cccccc !important;
}

.statement .el-radio__input.is-disabled.is-checked .el-radio__inner::after {
  background-color: #409eff !important;
}

.menuList {
  width: 100%;
  margin-top: 30px;

  .menuTitle {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #ebeef5;

    li {
      height: 40px;
      // width: 18%;
      width: calc(100% / 7);

      span {
        font-size: 16px;
        display: inline-block;
        height: 100%;
        line-height: 40px;
        width: 100%;

        text-align: left;
      }

      // &:nth-child(3) {
      // width: 10%
      // }
    }
  }

  .menuBody {
    border-bottom: 1px solid #ebeef5;
    width: 100%;

    li.menuitem {
      width: 100%;

      div {
        height: 50px;
        display: flex;
        width: calc(100% / 7);
        align-items: center;
        font-size: 14px;

        // &:nth-child(3) {
        //   width: 10%
        // }

        a {
          margin-right: 15px;
          color: #409eff;

          &:hover {
            cursor: pointer;
            color: #1268c1;
          }
        }
      }
    }
  }

  .subMenu {
    width: 100%;
    min-height: 50px;
    display: none;
    padding-left: 20px;

    .subItem {
      width: 100%;
      height: 50px;

      div {
        float: left;
      }
    }
  }
}

.topInfo {
  width: 100%;
  display: flex;
  justify-content: space-between;
  height: 40px;
  line-height: 40px;

  span {
    font-size: 20px;
    color: #666;
  }
}

</style>
